﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
namespace WebClient.admin.Modules.userGroups
{
    public partial class AddNew : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.btnAddNew.Attributes.Add("onclick", "return OnSubmitClick();");
            this.btnCancel.Attributes.Add("onclick", "return ClearAll()");
        }

        private void AddNews()
        {
            WebData data = new WebData();
            Usergroups item = new Usergroups();
            item.id = Convert.ToInt32(this.txtid.Text.Trim());
            item.groupName = this.txtgroupName.Text.Trim();
            item.description = this.txtdescription.Text.Trim();
            item.isActive = Convert.ToInt32(this.txtisActive.Text.Trim());
            data.OnSubmitUsergroups(item, 0);
        }
        protected void btnAddNew_Click(object sender, EventArgs e)
        {
            AddNews();
        }
    }
}